package com.lbloca.locate.ui.activity;

import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.widget.Toolbar;

import com.gyf.immersionbar.ImmersionBar;
import com.lbloca.locate.R;
import com.lbloca.locate.ui.base.BaseActivity;

import butterknife.BindView;

public class PrivacyNotesActivity extends BaseActivity {

    public static final String ARG_TYPE = "arg_type";
    public static final String ARG_TITLE = "arg_title";

    @BindView(R.id.tv_agree)
    TextView tvAgree;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_content)
    TextView tvContent;
    @BindView(R.id.id_toolbar)
    Toolbar mToolbar;

    private int type;

    @Override
    protected void initData() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_privacy_notes;
    }

    @Override
    protected void initView() {
        type = getIntent().getIntExtra(ARG_TYPE, 0);
        if (type == 1) {
            tvAgree.setVisibility(View.VISIBLE);
        }

        String title = getIntent().getStringExtra(ARG_TITLE);
        if (!TextUtils.isEmpty(title)) {
            tvTitle.setText(title);
            if (title.contains("隐私")) {
                tvContent.setText(R.string.yinsizc);
            } else {
                tvContent.setText(String.format(getString(R.string.yinsishengm), getString(R.string.app_name)));
            }
        }
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .statusBarDarkFont(true)
                .navigationBarDarkIcon(true)
                .titleBar(mToolbar)
                .init();
    }


    @Override
    protected void initEvents() {
        mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
    }


}
